home *** CD-ROM | disk | FTP | other *** search
- head 1.2;
- branch ;
- access ;
- symbols sprited:1.2.1;
- locks ; strict;
- comment @ * @;
-
-
- 1.2
- date 88.06.21.11.14.55; author ouster; state Exp;
- branches 1.2.1.1;
- next 1.1;
-
- 1.1
- date 88.06.19.14.29.14; author ouster; state Exp;
- branches ;
- next ;
-
- 1.2.1.1
- date 91.12.08.17.05.59; author kupfer; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.2
- log
- @Cleanup header usage.
- @
- text
- @/*
- * Fs_Write.c --
- *
- * Source code for the Fs_Write library procedure.
- *
- * Copyright 1988 Regents of the University of California
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies. The University of California
- * makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without
- * express or implied warranty.
- */
-
- #ifndef lint
- static char rcsid[] = "$Header: Fs_Write.c,v 1.1 88/06/19 14:29:14 ouster Exp $ SPRITE (Berkeley)";
- #endif not lint
-
- #include <sprite.h>
- #include <status.h>
- #include <fs.h>
-
-
- /*
- *----------------------------------------------------------------------
- *
- * Fs_Write --
- *
- * The "normal" Fs_Write interface for user code. Writes writeLength
- * characters from buffer to the file identified by streamID.
- * *amtWrittenPtr is updated to reflect how much data were actually
- * written.
- *
- * For some kinds of devices, Fs_Write causes the calling process to
- * block until the device is ready to accept the data. If a signal
- * is received by the process while it is blocked, then the
- * Fs_RawWrite system call will be aborted in order to process the
- * signal. When (if) the signal returns, the system call will return
- * a GEN_ABORTED_BY_SIGNAL status, and *writeCountPtr will reflect
- * the number of bytes accepted by the device before the signal
- * occurred. This routine will detect this occurrence and
- * automatically restart the system call to write the remainder of
- * the data.
- *
- * Results:
- * An error code.
- *
- * Side effects:
- * The file offset is incremented to be after the data written.
- * The amtWrittenPtr is updated to reflect the amount actually written.
- *
- *----------------------------------------------------------------------
- */
-
- ReturnStatus
- Fs_Write(streamID, writeLength, buffer, amtWrittenPtr)
- int streamID; /* The user's index into its open file list */
- int writeLength; /* The amount of bytes to write */
- Address buffer; /* The data to be written */
- int *amtWrittenPtr; /* The amount of bytes actually written */
- {
- int amtWritten;
- ReturnStatus status;
-
- *amtWrittenPtr = 0;
- do {
- status = Fs_RawWrite(streamID, writeLength, buffer, &amtWritten);
- *amtWrittenPtr += amtWritten;
- if (status == GEN_ABORTED_BY_SIGNAL) {
- writeLength -= amtWritten;
- if (writeLength <= 0) {
- return(SUCCESS);
- }
- buffer += amtWritten;
- }
- } while (status == GEN_ABORTED_BY_SIGNAL);
- return(status);
- }
- @
-
-
- 1.2.1.1
- log
- @Initial branch for Sprite server.
- @
- text
- @d17 1
- a17 1
- static char rcsid[] = "$Header: /sprite/src/lib/c/syscall/RCS/Fs_Write.c,v 1.2 88/06/21 11:14:55 ouster Exp $ SPRITE (Berkeley)";
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d17 1
- a17 1
- static char rcsid[] = "$Header: proto.c,v 1.2 88/03/11 08:39:08 ouster Exp $ SPRITE (Berkeley)";
- d21 1
- @
-